'''
Created on Dec 5, 2009

@author: bodnaria
'''
from google.appengine.ext import db
 

def createComment(author, type, content):
    comment = Comment(author = author,
                  type = type,
                  content = content)
    comment.put()
    return comment
    
class Comment(db.Model):
    from User import User
    date = db.DateTimeProperty(auto_now=True)
    author = db.ReferenceProperty(User, required=True)
    content = db.TextProperty(required=True)
    
    def updateType(self, new_type):
        self.type = new_type
        self.put()
        
    def updateContent(self, content):
        self.content = content
        self.put()
    
    